<?php

class Controller_Modmain extends Controller_Base
{
	private $show_in_page = 1;
	
	public function __construct($parts) {		
		$this->parts        = $parts;
		$this->common_vars  = Registry::get("common_vars");
		$this->table_module = PRFX."pages";
		$this->tree_site    = Registry::get("tree_site");
	}

    public function out()
	{     /*
				$r = & Registry::get("MDB")->query("SELECT * FROM `".$this->table_module."` WHERE `Show`='1' AND `Parent`='".$this->common_vars["structure_id"]."' ORDER BY `Por` ".$this->limit.";");
                if (PEAR::isError($r)) {
                    die($r->getMessage().' ::: '.$r->getUserInfo());
                }				
				if($r->numRows())
				{					
					$C_ARRAY = array();				
					while ($item = $r->fetchRow(MDB2_FETCHMODE_ASSOC))
					{
						$C_ARRAY[] = array(							
							"item_vars" => $item
						);				
					}
					$out['navygation'] = $this->navyg;
					$out['c_array']    = $C_ARRAY;								
				}*/
		
        
		
		$out['header']      = $this->tree_site[0]["name"];
		$out['header_link'] = $this->tree_site[0]["redirect"] ? $this->tree_site[0]["redirect"] : "/".$this->tree_site[0]["sys_name"].ENDURL;
		$out['parts_first'] = $this->parts[1];
		$out['LEFT_MENU']   = (!in_array($this->parts[1], Registry::get("NoneLeftMenuSection")) ? menu::getSubMenu($this->tree_site[0]["id"], $this->parts[1]) : '');
		
		//print_r($this->tree_site);		
		Registry::get("smarty")->assign($out);
		return Registry::get("smarty")->fetch(TEMPLATE_SITE.$this->common_vars["controller_template"], Registry::get("cache_id"));	
    }
}

$controller = new Controller_Modmain($parts);
$site_module_out = $controller->out();

?>